package edu.ccut.saturn.studio.wfg.command;

import org.eclipse.gef.commands.Command;

import edu.ccut.saturn.studio.wfg.model.Connection;

public class ConnectionDeleteCommand extends Command {

	private static final String CONNECTION_DELETION = "connection deletion";
	private final Connection connection;

	public ConnectionDeleteCommand(Connection conn) {
		if (conn == null) {
			throw new IllegalArgumentException();
		}
		setLabel(CONNECTION_DELETION);
		this.connection = conn;
	}

	public void execute() {
		connection.disconnect();
	}

	public void undo() {
		connection.reconnect();
	}
}
